Repository navigation
Add application credit - #457
Conversation
| if application_credit_id: | ||
| return "%s/application_credits/%s" % (cls.site, application_credit_id) | ||
| else: | ||
| return "%s" % (cls.site) |
There was a problem hiding this comment.
tbh I'm not sure if this part is right... this was how I got it to return the site with /application_credits tacked onto the end
There was a problem hiding this comment.
Overloading the _prefix isn't necessary here, it's only needed for resources that can be conditionally accessed at different routes, e.g. variants can be accessed from /admin/#{product_id}/#{variant_id}, or simply /admin/#{variant_id}.
| from ..base import ShopifyResource | ||
|
|
||
| class ApplicationCredit(ShopifyResource): | ||
| _prefix_source = "application_credits/$application_credit_id/" |
There was a problem hiding this comment.
I don't believe you need to specify this and add logic for the _prefix, pyactiveresource will default to application_credits/$id naturally. A pass here should still work
There was a problem hiding this comment.
+1 for pass, check out the implementation in the Ruby client library: https://github.com/Shopify/shopify_api/blob/master/lib/shopify_api/resources/application_credit.rb
pyactiveresource should be able to do all of the heavy lifting here with no special logic
There was a problem hiding this comment.
Okay thank you so much @mllemango @jamiemtdwyer
WHY are these changes introduced?
Fixes #343
WHAT is this pull request doing?
Checklist